<meta charset="utf-8">
<!-- <script src="main.js"></script> -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<style>
  


</style>
<body>
    

    <div id="app">
     
      <button @click="flag=!flag">toggle</button>
      <!-- 更高的性能消耗 -->
      <p v-if="flag">v-if</p> 
      <!-- 较高的初始渲染消耗 -->
      <p v-show="flag">v-if</p>

    </div>
    </body>


    <script>
        var vm = new Vue({
          el: '#app',
          data: {
            flag: false,

          },
          
        


        });
    </script>